package org.ezplatform.office.questionnaire.entity;
 
import java.util.List;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;

import org.ezplatform.core.annotation.MetaData;
import org.ezplatform.core.entity.BaseNativeEntity;

@MetaData(value = "题库题目")
@Entity(name = "QuestionnaireSetTopic")
@Table(name = "oa_questionnaire_set_topic", uniqueConstraints = { @UniqueConstraint(columnNames = "id") })
public class QuestionnaireSetTopic extends BaseNativeEntity{

	private static final long serialVersionUID = 4477793823544946239L;
	
	@MetaData(value = "题库Id")
  	@Column(name = "set_id", nullable = false, length = 32)
    private String setId;
	
	@MetaData(value = "题目名称")
  	@Column(name = "topic_name")
    private String topicName;
	
	@MetaData(value = "题目名称文本")
  	@Column(name = "topic_name_txt")
    private String topicNameTxt;
	
	@MetaData(value = "题目序号")
  	@Column(name = "topic_no", length = 10)
    private String topicNo;
	
	@MetaData(value = "题目设置")
  	@Column(name = "topic_setting", length = 500)
    private String topicSetting;
	
	@MetaData(value = "题型")
  	@Column(name = "topic_type", length = 100)
    private String topicType;

	/**
	 * 题型枚举 (部分)
	 */
	public enum TopicTypeEnum{
		/**
		 * 问答题
		 */
		ANSWER("answer","问答题"),
		/**
		 * 填空题
		 */
		FILLINBLANKS("fillInBlanks","填空题"),
		/**
		 * 附件题型
		 */
		FIELD("field","附件题型"),
		/**
		 * 量表
		 */
		SCALE("scale","量表"),
		/**
		 * 矩阵量表
		 */
		MULSCALE("mulscale","矩阵量表");
		private String code;
		private String value;
		TopicTypeEnum(String code,String value){
			this.code = code;
			this.value = value;
		}
		public String getCode() {
			return code;
		}
		public String getValue() {
			return value;
		}
	}
	
	@MetaData(value = "题目时间戳")
  	@Column(name = "times", length = 255)
    private String times;
	
	@MetaData(value = "排序码")
  	@Column(name = "sort_no", length = 11)
    private int sortNo;
	
	@Transient
	private Map<String,Object> settingMap;
	
	@Transient
	private List<QuestionnaireSetItems> list;
	
	@Transient
	private String ruleTopicName;

	/**
	 * @return the setId
	 */
	public String getSetId() {
		return setId;
	}

	/**
	 * @param setId the setId to set
	 */
	public void setSetId(String setId) {
		this.setId = setId;
	}

	/**
	 * @return the topicName
	 */
	public String getTopicName() {
		return topicName;
	}

	/**
	 * @param topicName the topicName to set
	 */
	public void setTopicName(String topicName) {
		this.topicName = topicName;
	}

	/**
	 * @return the topicNameTxt
	 */
	public String getTopicNameTxt() {
		return topicNameTxt;
	}

	/**
	 * @param topicNameTxt the topicNameTxt to set
	 */
	public void setTopicNameTxt(String topicNameTxt) {
		this.topicNameTxt = topicNameTxt;
	}

	/**
	 * @return the topicNo
	 */
	public String getTopicNo() {
		return topicNo;
	}

	/**
	 * @param topicNo the topicNo to set
	 */
	public void setTopicNo(String topicNo) {
		this.topicNo = topicNo;
	}

	/**
	 * @return the topicSetting
	 */
	public String getTopicSetting() {
		return topicSetting;
	}

	/**
	 * @param topicSetting the topicSetting to set
	 */
	public void setTopicSetting(String topicSetting) {
		this.topicSetting = topicSetting;
	}

	/**
	 * @return the topicType
	 */
	public String getTopicType() {
		return topicType;
	}

	/**
	 * @param topicType the topicType to set
	 */
	public void setTopicType(String topicType) {
		this.topicType = topicType;
	}

	/**
	 * @return the times
	 */
	public String getTimes() {
		return times;
	}

	/**
	 * @param times the times to set
	 */
	public void setTimes(String times) {
		this.times = times;
	}

	/**
	 * @return the settingMap
	 */
	public Map<String, Object> getSettingMap() {
		return settingMap;
	}

	/**
	 * @param settingMap the settingMap to set
	 */
	public void setSettingMap(Map<String, Object> settingMap) {
		this.settingMap = settingMap;
	}

	/**
	 * @return the list
	 */
	public List<QuestionnaireSetItems> getList() {
		return list;
	}

	/**
	 * @param list the list to set
	 */
	public void setList(List<QuestionnaireSetItems> list) {
		this.list = list;
	}

	/**
	 * @return the ruleTopicName
	 */
	public String getRuleTopicName() {
		return ruleTopicName;
	}

	/**
	 * @param ruleTopicName the ruleTopicName to set
	 */
	public void setRuleTopicName(String ruleTopicName) {
		this.ruleTopicName = ruleTopicName;
	}

	/**
	 * @return the sortNo
	 */
	public int getSortNo() {
		return sortNo;
	}

	/**
	 * @param sortNo the sortNo to set
	 */
	public void setSortNo(int sortNo) {
		this.sortNo = sortNo;
	}
	
}